#ifndef __DC02BCF2_DAEA_4456_B85D_EB0DBE00346C__
#define __DC02BCF2_DAEA_4456_B85D_EB0DBE00346C__

#include "../import/head.h"
#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos
{
    // 
    // dynamic_impl
    // 
    class dynamic_impl : public xos_stl::mem_pool_item< dynamic_impl, thread_lock >,
        public i_dynamic
    {
    public:
        dynamic_impl();
        ~dynamic_impl();

    protected:
        void * m_hModule;

    public:
        int init();
        int term();

    public:
        // 
        // use different ext whith different platform. win is dll, linux is so, mac is dylib
        // 
        int load( const char * lpszFile );

        // 
        // get proc address by name
        // 
        void * get_proc_by_name( const char * lpszProcName );

        // 
        // free loaded module
        //
        int free();

        // 
        // release
        // 
        int release();
    };
} // xos

#endif // __DC02BCF2_DAEA_4456_B85D_EB0DBE00346C__
